﻿using Daily.Application.DTO;
using DailyApp.WPF.Models;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace DailyApp.WPF.ViewModels
{
    public class SettingsViewModel : BindableBase
    {
        private readonly IRegionManager regionManager;
        public SettingsViewModel(IRegionManager regionManager)
        {
            MenuList =
             [
                 new LeftMenuInfo() { Icon = "Palette", MenuName = "个性化", ViewName = "PersionalUC" },
                 new LeftMenuInfo() { Icon = "Cog", MenuName = "系统设置", ViewName = "SysSetUC" },
                 new LeftMenuInfo() { Icon = "Information", MenuName = "关于更多", ViewName = "AboutUsUC" },
             ];
            NavigateCommand = new DelegateCommand<LeftMenuInfo>(Navigate);
            this.regionManager = regionManager;
        }
        #region 实现方法
        private void Navigate(LeftMenuInfo menu)
        {
            if (menu == null || string.IsNullOrEmpty(menu.ViewName)) return;
            regionManager.Regions["SettingRegion"].RequestNavigate(menu.ViewName);

        }


        #endregion

        #region 定义方法
        public DelegateCommand<LeftMenuInfo> NavigateCommand { get; set; }

        #endregion

        #region 属性

        private List<LeftMenuInfo> menuList;

        public List<LeftMenuInfo> MenuList
        {
            get { return menuList; }
            set { menuList = value; RaisePropertyChanged(); }
        }

        #endregion


    }
}
